package wickethub.web.app;


import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import org.apache.wicket.Request;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebSession;

import wickethub.domain.Resource;

public class WicketHubWebSession extends WebSession {
	
	private Set<Resource> ratedResources = Collections.synchronizedSet(new HashSet<Resource>());

	public WicketHubWebSession(Request request) {
		super(request);
	}
	
	public static WicketHubWebSession get() {
		  return (WicketHubWebSession) Session.get();
	}

	public Boolean isRated(Resource module) {
		return ratedResources.contains(module);
	}	
	
	public void addRatedModule(Resource module) {
		ratedResources.add(module);
	}


}